package com.heatup.apt.common.dao;

import com.heatup.apt.model.CashcardInfo;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.baomidou.mybatisplus.mapper.AutoMapper;
import com.baomidou.mybatisplus.plugins.Page;
import org.springframework.stereotype.*;

/**
 *
 * CashcardInfo 表数据库控制层接口
 *
 */
@Component
public interface CashcardInfoMapper extends AutoMapper<CashcardInfo> {

	CashcardInfo selectByPrimaryKey(Integer id);
	
	CashcardInfo selectByChangeCode(@Param("code") String code);
	
	List<CashcardInfo> queryCashcardInfoPage(Page<CashcardInfo> page,Map<String,Object> map);
	
	/**
	 * 用于新增查询是否在
	 * 有效期之内保证一个兑换码只能有一个有效
	 * @param code
	 * @return
	 */
	CashcardInfo selectByChangeCodeToAdd(@Param("code") String code);
	
	

}